Technology developments have enabled the implementation of a wide variety of sensors into a correspondingly wide variety of devices. In general, sensors detect or measure physical or environmental properties. Depending on the condition being measured, some sensors, such as thermometers, are able to deliver desired information at an instantaneous moment without accounting for time. In other applications, however, the sensor may output data that is further processed with timing parameters in order to obtain the desired information. For example, the quantity measured by the sensor may represent a derivative of another quantity. In the case of a gyroscope, the sensor outputs a measured angular velocity. Thus, to determine an orientation of a device equipped with a gyroscope, measured angular velocities may be integrated over time to determine the angular orientation. Similarly, the data output by an accelerometer may be singly integrated to derive a linear velocity for the device and doubly integrated to determine distance traveled. Other sensor applications may also rely on integration or other operations that utilize timing parameters to derive the desired information.
Therefore, the quality of the information determined in sensor applications that involve processing the obtained data with timing parameters may be improved by having accurate timing information for the samples being output by the sensor. In one aspect, this may involve associating time stamps with a plurality of sensor data samples. Depending on the architecture of the sensor, there may be a clock associated with the sensor that is used for coordinating operations of the sensor and/or establishing a sampling rate. Using a highly accurate clock in such applications may not be practically feasible due to the costs involved or the chosen architecture. As such, some sensor designs employ clocks based on resistance-capacitance (RC) designs or other similar circuits that are relatively inexpensive but may not offer the accuracy associated with more sophisticated techniques, such as crystal controlled oscillators. Therefore, integration operations relying on time stamps derived from the sensor clock may suffer from a correspondingly reduced accuracy.
In some applications, the sensor may output data to a host processor. Often, the host processor employs a clock source that is more accurate than the sensor clock. Thus, utilizing the host processor clock to determine time stamps for data samples obtained from the sensor may result in improved performance. However, such techniques have limitations. Typically, the sensor outputs a sequence of data samples at the frequency established by the sampling rate of the sensor. One or more of the samples are then stored in a buffer or other memory structure to be retrieved by the host processor. The host processor clock (or another system clock) is used to determine time stamps for the samples when they are retrieved from the buffer, typically after receiving an interrupt from the sensor that signals availability of data. Since the host processor may be performing other operations or may be in a power save mode, a variable delay is introduced between the time when each sample becomes available for retrieval and the time when each sample is actually retrieved. Therefore, even though a more accurate clock may be employed to provide the time stamp information, timing errors may still exist, undermining the precision of the integration operations.
Accordingly, there remains a need for techniques to time stamp samples of sensor data in a manner that provides more accurate determinations. In one aspect, this may include adjusting one or more time stamps to correct a time interval between samples. As will be described in the material that follows, the techniques of this disclosure satisfy this and other needs.